unit rmClassMethod;
interface
uses
  Classes,Graphics,AcroMultiClassMethod;
implementation
uses
  RM_Class;
procedure Proc_TRMMemoView(ATable:IDataLocate;AComponent:TObject;
  ACodePage,ASeqNo:string;AFont:TFont);
var
  i:integer;
begin
  for i:=0 to TRMMemoView(AComponent).Memo.Count-1 do
    TRMMemoView(AComponent).Memo[i]:=
      GetDisplayValue(ATable,TRMMemoView(AComponent).Memo[i],ACodePage,ASeqNo);
end;

procedure Proc_TRMPage(ATable:IDataLocate;AComponent:TObject;
  ACodePage,ASeqNo:string;AFont:TFont);
var
  i:integer;
  ACM:TClassMethod;
  AO:TObject;
begin
  for i:=0 to TRMPage(AComponent).Objects.Count-1 do
  begin
    AO:=TObject(TRMPage(AComponent).Objects.Items[i]);
    ACM:=AcroClassMethodStorage.GetNearstClassMethod(AO.ClassType);
    if ACM<>nil then ACM.MLMethod(ATable,AO,ACodePage,ASeqNo,AFont);
  end;
end;

procedure Proc_TRMPages(ATable:IDataLocate;AComponent:TObject;
  ACodePage,ASeqNo:string;AFont:TFont);
var
  i:integer;
begin
  for i:=0 to TRMPages(AComponent).Count-1 do
    Proc_TRMPage(ATable,TRMPages(AComponent).Pages[i],ACodePage,ASeqNo,AFont);
end;

procedure Proc_TRMReport(ATable:IDataLocate;AComponent:TObject;
  ACodePage,ASeqNo:string;AFont:TFont);
begin
  Proc_TRMPages(ATable,TRMReport(AComponent).Pages,ACodePage,ASeqNo,AFont);
end;

initialization
  AcroClassMethodStorage.RegisterClassMethod(TRMReport,Proc_TRMReport);
  AcroClassMethodStorage.RegisterClassMethod(TRMMemoView,Proc_TRMMemoView);
  AcroClassMethodStorage.RegisterClassMethod(TRMPage,Proc_TRMPage);
  AcroClassMethodStorage.RegisterClassMethod(TRMPages,Proc_TRMPages);
finalization
  AcroClassMethodStorage.UnRegisterClassMethod(TRMPages);
  AcroClassMethodStorage.UnRegisterClassMethod(TRMPage);
  AcroClassMethodStorage.UnRegisterClassMethod(TRMMemoView);
  AcroClassMethodStorage.UnRegisterClassMethod(TRMReport);
end.
